home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / perl-faq.part2 < prev    next >
Encoding:
Internet Message Format  |  1993-10-03  |  23.3 KB

  1. Subject: Perl Frequently Asked Questions, part 2 of 4
  2. Newsgroups: comp.lang.perl,news.answers
  3. From: Tom Christiansen <tchrist@cs.Colorado.EDU>
  4. Date: Sat, 2 Oct 1993 06:37:26 GMT
  5.  
  6. Archive-name: perl-faq/part2
  7. Version: $Id: perl-info2,v 1.1 93/10/02 00:27:07 tchrist Exp Locker: tchrist $
  8.  
  9. This posting contains answers to general information questions,
  10. mostly of a non-technical nature.  The following questions are 
  11. answered in this posting:
  12.  
  13. 1.21) Is there a Perl profiler?
  14. 1.22) Is there a yacc for Perl?
  15. 1.23) How can I use curses with perl?
  16. 1.24) How can I use X with Perl?
  17. 1.25) What is perl4?  What is perl5?
  18. 1.26) How does Perl compare with languages like REXX or TCL?
  19. 1.27) Is it a Perl program or a Perl script?
  20. 1.28) What's the difference between "Perl" and "perl"?
  21. 1.29) What companies use or ship Perl?
  22. 1.30) Is there commercial, 3rd-party support for Perl?
  23. 1.31) Where can I get a list of the JAPH signature quotes?
  24. 1.32) Where can I get a list of Larry Wall witticisms?
  25. 1.33) Is there a pretty-printer for Perl?
  26. 1.34) Can I dynamically load C user routines?
  27.  
  28.  
  29. 1.21) Is there a Perl profiler?
  30.  
  31.     While there isn't one included with the perl source distribution (yet)
  32.     various folks have written packages that allow you to do at least some
  33.     sort of profiling.  The strategy usually includes modifying the perl
  34.     debugger to handle profiling.  Authors of these packages include
  35.  
  36.     Wayne Thompson         <me@anywhere.EBay.Sun.COM>
  37.     Ray Lischner         <lisch@sysserver1.mentor.com>
  38.     Kresten Krab Thorup     <krab@iesd.auc.dk>  
  39.  
  40.     The original articles by these folks containing their
  41.     profilers are available on convex.com in 
  42.     /pub/perl/information/profiling.shar via anon ftp.
  43.  
  44.  
  45. 1.22) Is there a yacc for Perl?
  46.  
  47.     Yes!! It's a version of Berkeley yacc that outputs Perl code instead
  48.     of C code!  You can get this from ftp.sterling.com [192.124.9.1] in
  49.     /local/perl-byacc1.8.1.tar.Z, or send the author mail for details.
  50.  
  51.  
  52. 1.23) How can I use curses with perl?
  53.  
  54.     One way is to build a curseperl binary by linking in your C curses
  55.     library as described in the usub subdirectory of the perl sources.
  56.     This requires a modicum of work, but it will be reasonably fast
  57.     since it's all in C (assuming you consider curses reasonably fast. :-)  
  58.     Programs written using this method require the modified curseperl,
  59.     not vanilla perl, to run.  While this is something of a disadvantage,
  60.     experience indicates that it's better to use curseperl than to 
  61.     try to roll your own using termcap directly.
  62.  
  63.     For a good example of using curseperl, you might want to pick up a
  64.     copy of  Steven L Kunz's <skunz@iastate.edu> "perl menus" package
  65.     ("menu.pl") via anonymous FTP from "ftp.iastate.edu".  It's in the
  66.     /pub/perl as
  67.  
  68.     menu.pl.v1.4.shar
  69.     menu.pl.v2.0.shr1
  70.     menu.pl.v2.0.shr2
  71.     menu.pl.v2.0.tar.Z
  72.  
  73.     menus.pl is a complete menu front-end for curseperl and demonstates
  74.     a lot of things (plus it is useful to boot if you want full-screen
  75.     menu selection ability).
  76.  
  77.     Another possibility is to use Henk Penning's cterm package, a curses
  78.     emulation library written in perl.  cterm is actually a separate
  79.     program with which you communicate via a pipe.  It is available from
  80.     ftp.cs.ruu.nl [131.211.80.17] via anonymous ftp. in the directory
  81.     pub/PERL.  You may also acquire the package via email in compressed,
  82.     uuencoded form by sending a message to mail-server@cs.ruu.nl
  83.     containing these lines:
  84.  
  85.     begin
  86.     send PERL/cterm.shar.Z
  87.     end
  88.  
  89.     See the question on retrieving perl via mail for more information on
  90.     how to get retrieve other items of interest from the mail server
  91.     there.
  92.  
  93.  
  94. 1.24) How can I use X with Perl?
  95.  
  96.     Right now, you have several choices.  You can wait for perl5, use
  97.     the WAFE or STDWIN packages, or try to make your own usub bindings. 
  98.  
  99.     Perl5 is anticipated to be released with bindings for X, called 
  100.     guiperl.  An exciting prototype for this, written by Jon Biggar
  101.     <jon@netlabs.com>, Larry's *other* brother-in-law and officemate, 
  102.     is already up and running inside of Netlabs.  This program addresses
  103.     the same dynamic gui-building problem space as does tcl/tk.
  104.     
  105.     If you can't wait or don't think that guiperl will do what you want,
  106.     a stab at Motif bindings was begun by Theodore C. Law
  107.     <TEDLAW@TOROLAB6.VNET.IBM.COM> area.  His article about this is 
  108.     on convex.com in /pub/perl/info/motif for anon ftp.
  109.  
  110.     STDWIN is a library written by Guido van Rossum <guido@cwi.nl>
  111.     (author of the Python programming language) that is portable 
  112.     between Mac, Dos and X11.  One could write a Perl agent to
  113.     speak to this STDWIN server.
  114.  
  115.     WAFE is a package that implements a symbolic interface to the Athena
  116.     widgets (X11R5). A typical Wafe application consists in our framework
  117.     of two parts: the front-end (we call it Wafe for Widget[Athena]front
  118.     end) and an application program running typically as separate process.
  119.     The application program can be implemented in an arbitrary programming
  120.     language and talks to the front-end via stdio.  Since Wafe (the
  121.     front-end) was developed using the extensible TCL shell (cite John
  122.     Ousterhout), an application program can dynamically submit requests to
  123.     the front-end to build up the graphical user interface; the
  124.     application can even down-load application specific procedures into
  125.     the front-end.  The distribution contains sample application programs
  126.     in Perl, GAWK, Prolog, TCL, and C talking to the same Wafe binary.
  127.     Many of the demo applications are implemented in Perl.  Wafe 0.9 can
  128.     be obtained via anonymous ftp from 
  129.     ftp.wu-wien.ac.at:pub/src/X11/wafe-0.9.tar.Z
  130.     (for people without name server: the ip address is 137.208.3.5)
  131.  
  132.     Alternatively, you could use wish from tcl. 
  133.  
  134.     #!/usr/local/bin/perl
  135.     #####################################################################
  136.     #  An example of calling wish as a subshell under Perl and
  137.     #  interactively communicating with it through sockets.
  138.     #
  139.     #  The script is directly based on Gustaf Neumann's perlwafe script.
  140.     #
  141.     #  Dov Grobgeld dov@menora.weizmann.ac.il
  142.     #  1993-05-17
  143.     #####################################################################
  144.  
  145.     $wishbin = "/usr/local/bin/wish";
  146.  
  147.     die "socketpair unsuccessful: $!!\n" unless socketpair(W0,WISH,1,1,0);
  148.     if ($pid=fork) {
  149.         select(WISH); $| = 1;
  150.         select(STDOUT);
  151.  
  152.     # Create some TCL procedures
  153.         print WISH 'proc echo {s} {puts stdout $s; flush stdout}',"\n";
  154.  
  155.     # Create the widgets
  156.     print WISH <<TCL;
  157.     # This is a comment "inside" wish
  158.  
  159.     frame .f -relief raised -border 1 -bg green
  160.     pack append . .f {top fill expand}
  161.  
  162.     button .f.button-pressme -text "Press me" -command {
  163.         echo "That's nice."
  164.     }
  165.     button .f.button-quit -text quit -command {
  166.         echo "quit"
  167.     }
  168.     pack append .f .f.button-pressme {top fill expand} \\
  169.                .f.button-quit {top expand}
  170.  
  171. TCL
  172.     ;
  173.     # Here is the main loop which receives and sends commands
  174.     # to wish.
  175.     while (<WISH>) {
  176.         chop;
  177.         print "Wish sais: <$_>\n";
  178.         if (/^quit/) { print WISH "destroy .\n"; last; }
  179.     }
  180.         wait;
  181.     } elsif (defined $pid) {
  182.     open(STDOUT, ">&W0");
  183.     open(STDIN, ">&W0");
  184.     close(W0);
  185.     select(STDOUT); $| = 1;
  186.     exec "$wishbin --";
  187.     } else {
  188.     die "fork error: $!\n";
  189.     }
  190.  
  191.  
  192.  
  193. 1.25) What is perl4?  What is perl5?
  194.  
  195.     The answer to what is perl4 is nearly anything you might otherwise 
  196.     program in shell or C.  The answer to what is perl5 is basically
  197.     Perl: the Next Generation.  In fact, it's essentially a complete
  198.     rewrite of perl from the bottom up, and back again.  It's available
  199.     in alpha form (alpha-2 now, alpha-3 soon).   The only docs for this stuff
  200.     is what you're about to read, and what's in the t/op/ref.t file.
  201.  
  202.     Here are the things which are already done:
  203.     a faster, tighter, more flexible interpreter 
  204.  
  205.     new token "=>" as synonym for ","; this makes 
  206.         tables look nicer
  207.         %T = ( OC => $red,
  208.               TOF => "\f",
  209.              );
  210.         and provides for named argument passing:
  211.         &some_func( OC => $red, TOF => "\f");
  212.  
  213.     recursive lists and tables:
  214.         [a, b, [c, d], e] has 4 elts, the 3rd being itself a list
  215.         $r->[3]->{PEANUT}; $r is a reference to a list 
  216.                 of references to tables
  217.  
  218.     typed pointers (references) and generalized indirection:
  219.         like @{$aptr} or &{$fptr} or &{ $table[$index] . "func" }().
  220.  
  221.     merging of list operator and function calling syntax:
  222.         split /pat/, $string;
  223.  
  224.     the ref operator to find out what something is a reference to
  225.  
  226.     object oriented programming:
  227.         $o->func(); # call the func member function of whatever class $o is
  228.  
  229.     inheritance of object types through the @ISA array
  230.     much improved -w checking
  231.     lexical scoping with the my operator
  232.  
  233.     safe global variables through package statements 
  234.         forces variable declarations, but only if you want it
  235.  
  236.     per-package END functions triggered at die() or exit()
  237.     embeddable Perl code in C code: cc prog.c -lperl 
  238.  
  239.     oo syntactic extensions:
  240.         $dog->give($bone);
  241.         is like
  242.         give $dog $bone; 
  243.         and 
  244.         $STDOUT->flush(1);
  245.         is like
  246.         flush $STDOUT 1;  
  247.     multiple co-resident perl interpreters: 
  248.  
  249.     Here is what is hoped to be done for production, but might not:
  250.     very easy GUI Perl applications using high-level X bindings ("guiperl")
  251.     subroutines without &'s:   myfunc($arg);
  252.     mnemonic aliases for $<punctuation> variables
  253.     file handle objects: $STDOUT->flush(1);
  254.     cleanup (namespace pollution) and documentation 
  255.         (eg. man 3pl getopt) of libraries
  256.     addition of several new libraries (atexit, autoload, etc.)
  257.     update h2ph and c2ph 
  258.     misc perl development tools 
  259.     a perl profiler
  260.     POSIX compatibility
  261.  
  262.     Here is what is hope to eventually be done but very probably not in
  263.     the first production release:
  264.     generalization of dbm binding for assoc arrays to handle
  265.         any generic fetch/store/open/close/flush package.
  266.         (thus allowing both dbm and gdbm at once)
  267.     dynamic loading of C libraries for systems that can
  268.     byte-compiled code for speed and maybe security
  269.  
  270.     And here are the things that will no longer work that used to:
  271.     open FILE || die;
  272.     $c = shift @a + 1;
  273.  
  274.     It's tempting to want this stuff soon, since the sooner it comes
  275.     out the sooner we can all build really cool applications.  But the
  276.     longer Larry works on it, the more items from this list will actually
  277.     get done, and the more robust the release will be.  So let's not
  278.     ask him about it too often.  Larry says (slightly edited):
  279.  
  280.     I've put a tar of my current Perl 5 directory onto
  281.     ftp.netlabs.com, in pub/outgoing/perl5.0/perl5a2.tar.Z.
  282.  
  283.     Now's your chance to check out all the bugs I said I fixed in
  284.     Perl 5.  :-)
  285.  
  286.     Before you get all twitterpated, this is unsupported "alpha 2"
  287.     code.  There is no Configure, only a makefile.  It will
  288.     probably only work on a Sun4.  The compiler and interpreter are
  289.     still very much unoptimized (though it already runs as fast or
  290.     faster than Perl 4).  It doesn't do everything that I want it
  291.     to yet.  It doesn't have "my" yet (though it's got the innards
  292.     for it).  It doesn't have a debugger.
  293.  
  294.     Like the Alpha 1 prerelease, this is an unsupported code.  It is
  295.     expected to work only on a Sparc architecture machine.  No
  296.     Configure support is provided.  In fact, if you succeed in
  297.     configuring and making a new makefile, you'll probably overwrite
  298.     the only makefile that works.  (Note that a Sparc executable comes
  299.     with the kit, so you may not need to compile at all.) There is
  300.     no list of new features yet, but if you look at t/op/ref.t
  301.     you'll see some of them in use.  perl -Dxst is also fun.
  302.  
  303.     But it does have references, and you can play with them.  The
  304.     object oriented stuff is there too.  See the op/ref.t file for
  305.     how to use them.
  306.  
  307.     I smell some new JAPHs coming...
  308.  
  309.     I don't want to get stuck "supporting" this, but if you want to
  310.     run your favorite scripts past it and see which ones toss their
  311.     salad, you may.  If you can come up with a decent bug report
  312.     with a small test case, I'll certainly be glad to look at it.
  313.     I'm not really interested in obscure core dumps at the moment.
  314.     I'm still getting plenty of those on my own.
  315.  
  316.     I'm not yet interested in memory leak reports either.
  317.  
  318.     I can tell you that no program that uses the old autoloading
  319.     mechanism will run, since there is no visibility into the
  320.     symbol table pointers currently.  You ought to be able to
  321.     redefine a subroutine while it's running, though.  (I haven't
  322.     tested that in several months, however.  There oughta be a
  323.     regression test for that...)
  324.  
  325.     Don't bother trying to diff Perl 4 with Perl 5.  Everything is
  326.     different.  All names have been regularized.  Here's a key, if
  327.     you're brave and want to peek at the sources:
  328.  
  329.         SV      scalar value
  330.         AV      array value
  331.         HV      hash value
  332.         GV      glob value
  333.         CV      code value
  334.         RV      reference value
  335.         PV      pointer value
  336.         NV      numeric value
  337.         IV      integer value
  338.  
  339.  
  340. 1.26) How does Perl compare with languages like REXX or TCL?
  341.  
  342.     REXX is an interpreted programming language first seen on IBM systems,
  343.     and TCL is John Ousterhout's embeddable command language.  TCL's most
  344.     intriguing feature for many people is the tcl/tk toolset that allows
  345.     for interpreted X-based tools.
  346.  
  347.     To avoid any flamage, if you really want to know the answer to this
  348.     question, probably the best thing to do is try to write equivalent
  349.     code to do a set of tasks.  All three have their own newsgroups in
  350.     which you can learn about (but hopefully not argue about) these
  351.     languages.
  352.  
  353.     To find out more about these or other languages, you might also check
  354.     out David Muir Sharnoff <muir@tfs.com>'s posting on "Catalog of
  355.     compilers, interpreters, and other language tools" which he posts to
  356.     comp.lang.misc, comp.sources.d, comp.archives.admin, and the
  357.     news.answers newsgroups.  It's a comprehensive treatment of many
  358.     different languages.  (Caveat lector: he considers Perl's syntax
  359.     "unappealing".)   This list is archived on convex.com in 
  360.     /pub/perl/info/lang-survey.shar .
  361.  
  362.  
  363. 1.27) Is it a Perl program or a Perl script?
  364.  
  365.     Certainly. :-)
  366.  
  367.     Current UNIX parlance holds that anything interpreted
  368.     is a script, and anything compiled into native machine
  369.     code is a program.  However, others hold that a program
  370.     is a program is a program: after all, one seldom discusses
  371.     scripts written in BASIC or LISP.  Larry considers it
  372.     a program if it's set in stone and you can't change it,
  373.     whereas if you go in and hack on it, then it's a script.
  374.  
  375.     But doesn't really matter.  The terms are generally 
  376.     interchangeable today.
  377.  
  378.  
  379. 1.28) What's the difference between "Perl" and "perl"?
  380.  
  381.      32 :-)  [  ord('p') - ord('P')  ]
  382.  
  383.      Larry now uses "Perl" to signify the language proper and "perl" the
  384.      implementation of it, i.e. the current interpreter.  Hence tchrist's quip
  385.      that "Nothing but perl can parse Perl."
  386.  
  387.      On the other hand, the aesthetic value of casewise parallelism
  388.      in "awk", "sed", and "perl" as much require the lower-case 
  389.      version as "C", "Pascal", and "Perl" require the 
  390.      upper-case version.  It's also easier to type "Perl" in 
  391.      typeset print than to be constantly switching in Courier. :-)
  392.     
  393.      In other words, it doesn't matter much, especially if all
  394.      you're doing is hearing someone talk about the language;
  395.      case is hard to distinguish aurally.
  396.  
  397.  
  398. 1.29) What companies use or ship Perl?
  399.  
  400.     At this time, the known list of companies that ship Perl includes at
  401.     least the following, although some have snuck it into /usr/contrib
  402.     or its moral equivalent:
  403.  
  404.     BSDI
  405.     Comdisco Systems
  406.     CONVEX Computer Corporation
  407.     Crosspoint Solutions
  408.     Dell
  409.     DRD Corporation
  410.     Intergraph
  411.     Kubota Pacific 
  412.     Netlabs
  413.     Univel
  414.  
  415.     Furthermore, the following vendors are reported to begin shipping perl
  416.     standard with their systems in the very near future:
  417.  
  418.     Sun
  419.     SGI
  420.  
  421.     Some companies ship it on their "User Contributed Software Tape",
  422.     such as DEC and HP.  Apple Computer has shipped the MPW version of
  423.     Macintosh Perl on one of their Developer CDs (Essentials*Tools*Objects 
  424.     #11) (and they included it under "Essentials" :-)
  425.  
  426.     Many other companies use Perl internally for purposes of tools
  427.     development, systems administration, installation scripts, and test
  428.     suites.  Rumor has it that the large workstation vendors (the TLA set)
  429.     are seriously looking into shipping Perl with their standard systems
  430.     "soon".
  431.  
  432.     People with support contracts with their vendors are actively 
  433.     encouraged to submit enhancement requests that Perl be shipped 
  434.     as part of their standard system.  It would, at the very least,
  435.     reduce the FTP load on the Internet. :-)
  436.  
  437.     If you know of any others, please send them in.
  438.  
  439.  
  440. 1.30) Is there commercial, 3rd-party support for Perl?
  441.  
  442.     Not really.  Although perl is included in the GNU distribution, at
  443.     last check, Cygnus does not offer support for it.  However, it's
  444.     unclear whether they've ever been offered sufficient financial
  445.     incentive to do so.
  446.  
  447.     On the other hand, you do have comp.lang.perl as a totally gratis
  448.     support mechanism.  As long as you ask "interesting" questions, 
  449.     you'll probably get plenty of help. :-)
  450.  
  451.     While some vendors do ship Perl with their platforms, that doesn't
  452.     mean they support it on arbitrary other platforms.  And in fact, all
  453.     they'll probably do is forward any bug reports on to Larry.  In
  454.     practice, this is far better support than you could hope for from
  455.     nearly any vendor.
  456.  
  457.     The companies who won't use something unless they can pay money
  458.     for it will be left out.  Often they're motivated by wanting 
  459.     someone whom they could sue.  If all they want is someone to help
  460.     them out with Perl problems, there's always the net.  And if they
  461.     really want to pay someone for that help, well, Tom and Randal are
  462.     always looking for a job. :-)
  463.  
  464.     If companies want "commercial support" for it badly enough, speak
  465.     up -- something might be able to be arranged.
  466.  
  467.  
  468. 1.31) Where can I get a list of the JAPH signature quotes?
  469.  
  470.     These are the "just another perl hacker" signatures that
  471.     some people sign their postings with.  About 100 of the 
  472.     of the earlier ones are on convex.com in /pub/perl/info/japh.
  473.  
  474. 1.32) Where can I get a list of Larry Wall witticisms?
  475.  
  476.     Over a hundred quips by Larry, from postings of his or source code,
  477.     can be found on convex.com in /pub/perl/info/lwall-quotes.  
  478.  
  479. 1.33) Is there a pretty-printer for Perl?
  480.  
  481.     That depends on what you mean.  If you want something 
  482.     that works like vgrind on Perl programs, then the answer
  483.     is "yes, nearly".  Here's a vgrind entry for perl:
  484.  
  485.     PERL|perl|Perl:\
  486.         :pb=^\d?(sub|package)\d\p\d:\
  487.         :bb={:be=}:cb=#:ce=$:sb=":se=\e":lb=':\
  488.         :le=\e':tl:\
  489.         :id=_:\
  490.         :kw=\
  491.         if for foreach unless until while continue else elsif \
  492.         do eval require \
  493.         die exit \
  494.         defined delete reset \
  495.         goto last redo next dump \
  496.         local undef return  \
  497.         write format  \
  498.         sub package
  499.  
  500.     It doesn't actually do everything right; in particular, 
  501.     things like $#, $', s#/foo##, and $foo'bar all confuse it.
  502.  
  503.     David Levine uses this:
  504.  
  505.     # perl 4.x                        David Levine <levine@ics.uci.edu> 05 apr 1993
  506.     # Derived from Tom  Christiansen's perl vgrindef.   I'd  like to  treat all  of
  507.     # perl's  built-ins  as   keywords,  but  vgrind   fields are  limited  to 1024
  508.     # characters   and  the built-ins  overflow that  (surprise  :-).  So, I didn't
  509.     # include  the dbm*,  end*, get*,  msg*,  sem*, set*,  and  shm* functions.   I
  510.     # couldn't come  up  with an easy   way to  distinguish beginnings  of literals
  511.     # ('...') from package prefixes, so literals are not marked.
  512.     # Be sure to:
  513.     # 1) include whitespace between a subprogram name and its opening {
  514.     # 2) include whitespace before a comment (so that $# doesn't get interpreted as
  515.     #    one).
  516.     perl4:\
  517.         :pb=^\d?(sub|package)\d\p\d:\
  518.         :id=$%@_:\
  519.         :bb=\e{:be=\e}:cb=\d\e#:ce=$:sb=\e":se=\e":\
  520.         :kw=accept alarm atan2 bind binmode caller chdir chmod chop chown \
  521.     chroot close closedir connect continue cos crypt defined delete die do dump \
  522.     each else elsif eof eval exec exit exp fcntl fileno flock for foreach fork \
  523.     format getc gmtime goto grep hex if include index int ioctl join keys kill \
  524.     last length link listen local localtime log lstat m mkdir next oct open \
  525.     opendir ord pack package pipe pop print printf push q qq qx rand read readdir \
  526.     readlink recv redo rename require reset return reverse rewinddir rindex rmdir \
  527.     s scalar seek seekdir select send shift shutdown sin sleep socket socketpair \
  528.     sort splice split sprintf sqrt srand stat study sub substr symlink syscall \
  529.     sysread system syswrite tell telldir time times tr truncate umask undef \
  530.     unless unlink unpack unshift until utime values vec wait waitpid wantarray \
  531.     warn while write y:
  532.  
  533.     If what you mean is whether there is a program that will
  534.     reformat the program much as indent(1) will do for C, then
  535.     the answer is no.  The complex feedback between the scanner
  536.     and the parser (as in the things that confuse vgrind) make
  537.     it challenging at best to write a stand-alone C parser.
  538.  
  539. 1.34) Can I dynamically load C user routines?
  540.  
  541.     Yes, kinda.  One package has been released that does this, by
  542.     Roberto Salama <rs@fi.gs.com>.  He writes:
  543.  
  544.     Here is a version of dylperl, dynamic linker for perl. The code here
  545.     is based on Oliver Sharp's May 1993 article in Dr. Dobbs Journal
  546.     (Dynamic Linking under Berkeley UNIX).
  547.  
  548.           dyl.h 
  549.           dyl.c - code extracted from Oliver Sharp's article
  550.  
  551.           hash.h
  552.           hash.c - Berkeley's hash functions, should use perl's but could not
  553.                be bothered
  554.  
  555.        dylperl.c - perl usersubs
  556.           user.c - userinit function
  557.  
  558.         sample.c - sample code to be dyl'ed
  559.        sample2.c -          "
  560.          test.pl - sample perl script that dyl's sample*.o
  561.  
  562.     The Makefile assumes that uperl.o is in /usr/local/src/perl/... You
  563.     will probable have to change this to reflect your installation. Other
  564.     than that, just type 'make'...
  565.  
  566.     The idea behind being able to dynamnically link code into perl is that
  567.     the linked code should become perl functions, i.e. they can be invoked
  568.     as &foo(...).  For this to happen, the incrementally code must use the
  569.     perl stack, look at sample.c to get a better idea.
  570.  
  571.     The few functions that make up this package are outlined below.
  572.  
  573.     &dyl("file.o"): dynamically link file.o. All functions and non-static
  574.            variables become visible from within perl. This
  575.            function returns a pointer to an internal hash table
  576.            corresponding to the symbol table of the newly loaded
  577.            code.
  578.  
  579.            eg: $ht = &dyl("sample.o")
  580.  
  581.            This function can also be called with the -L and -l ld options.
  582.  
  583.            eg: $ht = &dyl(""sample2.o", "-L/usr/lib", "-lm")
  584.                will also pick up the math library if sample.o
  585.                accesses any symbols there.
  586.  
  587.     &dyl_find("func"): find symbol 'func' and return its symbol table entry
  588.  
  589.     &dyl_functions($ht): print the contents of the internal hash table
  590.     &dyl_print_symbols($f): prints the contents of the symbol returned by dyl_find()
  591.  
  592.     There is very little documentation, maybe something to do for a future
  593.     release.  The files sample.o, and sample2.o contain code to be
  594.     incrementally loaded, test.pl is the test perl script.
  595.  
  596.     Comments are welcome. I submit this code for public consumption and,
  597.     basically, am not responsible for it in any way.
  598. -- 
  599.     Tom Christiansen      tchrist@cs.colorado.edu       
  600.             Consultant
  601.     Boulder Colorado  303-444-3212
  602.  
  603.